---
title: PdfException
summary: API reference for PdfException.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-17
library: PdfAPI.Core
reference_type: package
---

# PdfException

`PdfException` is the domain exception thrown by [Validate PDF bytes](../../operations/op-01-validate-pdf-bytes.md) and [Validate a document](../../operations/op-02-validate-a-document.md) when input bytes are not a recognisable PDF, a document reference is missing, or a document fails to load. ([BR-03](../../business-rules.md#br-03-invalid-pdf-input-aborts-with-pdfexception), [BR-04](../../business-rules.md#br-04-document-validation-requires-a-non-null-document), [BR-06](../../business-rules.md#br-06-failed-document-load-aborts-validation))

## Purpose
- Signals invalid PDF input or a failed document load as a distinct, catchable exception type rather than a generic `Exception`.

## Context
- Namespace: `PdfAPI.Core`
- Assembly/package: `PdfAPI.Core`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| PdfException(string) | `PdfException(string message)` | Constructs the exception with a descriptive message. |
| PdfException(string, Exception) | `PdfException(string message, Exception inner)` | Constructs the exception with a message and an inner exception. |

## Behavioral notes
- `ValidatePdf` overloads throw `PdfException` synchronously; no operation in this library catches or wraps it further, so it propagates directly to the caller. ([BR-03](../../business-rules.md#br-03-invalid-pdf-input-aborts-with-pdfexception), [BR-04](../../business-rules.md#br-04-document-validation-requires-a-non-null-document), [BR-06](../../business-rules.md#br-06-failed-document-load-aborts-validation))

## Constraints and usage notes
- Catch `PdfException` specifically when a caller needs to distinguish invalid-PDF-input failures from other unexpected errors.

## Related documentation
- [Index](../../index.md)
- [Overview](../../overview.md)
- [Architecture](../../architecture.md)
- [Dependencies](../../dependencies.md)
- [Operations and processes](../../operations-processes.md)
- [Business rules](../../business-rules.md)
- [Security and authorization](../../security-authorization.md)
- [API reference](../index.md)

## Sources
- `PdfAPI.Core\PdfException.cs`
